import request from '@/utils/request'

// 查询分类品牌分页数据
export const GetCategoryBrandPage = (pageNum, pageSize, searchObj) => {
  return request({
    url: `/admin/product/categoryBrand/page/${pageNum}/${pageSize}`,
    method: 'get',
    params: searchObj,
  })
}
//根据id删除分类品牌
export const DeleteCategoryBrandById = id => {
  return request({
    url: `/admin/product/categoryBrand/deleteById/${id}`,
    method: 'DELETE',
  })
}
//根据id查询分类品牌
export const GetCategoryBrandById = id => {
  return request({
    url: `/admin/product/categoryBrand/getById/${id}`,
    method: 'GET',
  })
}
//更新分类品牌
export const UpdateCategoryBrandById = categoryBrand => {
  return request({
    url: `/admin/product/categoryBrand/updateById`,
    method: 'PUT',
    data: categoryBrand,
  })
}
//新增分类品牌
export const SaveCategoryBrand = categoryBrand => {
  return request({
    url: `/admin/product/categoryBrand/save`,
    method: 'POST',
    data: categoryBrand,
  })
}
// FindBrandByCategoryId
//TODO 根据分类id查询所有品牌
export const FindBrandByCategoryId = c3id => {
  return request({
    url: `/admin/product/categoryBrand/getAllBrandByC3id/${c3id}`,
    method: 'GET',
  })
}
